package cn.com.dbridge.common.websocket.task;

import cn.com.dbridge.common.websocket.netty.NettyConfig;
import cn.com.dbridge.common.websocket.netty.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class WebSocketCommandLineRunner implements CommandLineRunner {
    @Autowired
    private NettyConfig nettyConfig;

    /**
     * Callback used to run the bean.
     *
     * @param args incoming main method arguments
     * @throws Exception on error
     */
    @Override
    public void run(String... args) throws Exception {
        NettyServer.getInstance().run(nettyConfig);
    }
}
